CC = g++
CFLAGS = -Wall -O3


all:
	$(CC) $(CFLAGS) -c modules/BaseModule.cpp
	$(CC) $(CFLAGS) -fPIC -c modules/calc.cpp
	$(CC) $(CFLAGS) -shared -o calc.so calc.o BaseModule.o
	$(CC) $(CFLAGS) -fPIC -c modules/ping.cpp
	$(CC) $(CFLAGS) -shared -o ping.so ping.o BaseModule.o
	$(CC) $(CFLAGS) -fPIC -c modules/say.cpp
	$(CC) $(CFLAGS) -shared -o say.so say.o BaseModule.o
	$(CC) $(CFLAGS) -fPIC -c modules/wassup.cpp
	$(CC) $(CFLAGS) -shared -o wassup.so wassup.o BaseModule.o
	$(CC) $(CFLAGS) main.cpp modules/BaseModule.cpp -o main -lgloox -lpthread -ldl 
	mv *.so modules/ 
	rm *.o 
	strip main

